package cn.qn.moudle.sys;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.Table;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author Jeet
 * @description 系统消息
 * @date 2019/7/26 16:42
 */
@Entity(name = "sys_message")
@Data
@Table(appliesTo  = "sys_message",comment="系统消息")
public class SysMessage implements Serializable {

    private static final long serialVersionUID = -1879370592042656466L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id" ,columnDefinition="int(11) COMMENT '主键'")
    private Integer id;

    @Column(name = "user_id", columnDefinition = "varchar(20) COMMENT '用户编号'")
    private String userId;

    @Column(name = "create_time" ,columnDefinition="timestamp COMMENT '数据创建时间'")
    @Temporal(TemporalType.TIMESTAMP)
    @CreationTimestamp
    private Date createTime;

    @Column(name = "create_by",columnDefinition="varchar(30) COMMENT '创建人'")
    private String createBy;

    @Column(name = "title",columnDefinition="varchar(64) COMMENT '标题'")
    private String title;

    @Column(name = "has_read",columnDefinition="char(1) default 0 COMMENT '是否已读：1-已读，0-未读'")
    private String hasRead;

    @Column(name = "content",columnDefinition="varchar(255) COMMENT '内容'")
    private String content;

    @Column(name = "type",columnDefinition="int(1) COMMENT '类型'")
    private Integer type;


}
